﻿using System.Data;
using ET;

namespace DAL
{
    public class MCK_Symbol_TimeKeeper_DAL
    {
        private readonly clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable GetData_MCK_Symbol_TimeKeeper(string keywords)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@KeyWords", keywords);
            return cls.GetData("sp_MCK_Symbol_TimeKeeper_Select");
        }
        public DataTable GetDataRow_MCK_Symbol_TimeKeeper(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Symbol_TimeKeeper_ID", id);
            return cls.GetData("sp_MCK_Symbol_TimeKeeper_SelectRow");
        }
        #endregion

        #region Insert
        public bool Insert_MCK_Symbol_TimeKeeper(MCK_Symbol_TimeKeeper_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Symbol_TimeKeeper_Alias", data.Symbol_TimeKeeper_Alias);
            cls.AddParameter("@Symbol_TimeKeeper_Name", data.Symbol_TimeKeeper_Name);
            cls.AddParameter("@Symbol_TimeKeeper_Day", data.Symbol_TimeKeeper_Day);
            cls.AddParameter("@Symbol_TimeKeeper_Group", data.Symbol_TimeKeeper_Group);
            cls.AddParameter("@Symbol_TimeKeeper_Note", data.Symbol_TimeKeeper_Note);
            return cls.ExecuteNonQuery("sp_MCK_Symbol_TimeKeeper_Insert");
        }
        #endregion

        #region Update
        public bool Update_MCK_Symbol_TimeKeeper(MCK_Symbol_TimeKeeper_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Symbol_TimeKeeper_ID", data.Symbol_TimeKeeper_ID);
            cls.AddParameter("@Symbol_TimeKeeper_Alias", data.Symbol_TimeKeeper_Alias);
            cls.AddParameter("@Symbol_TimeKeeper_Name", data.Symbol_TimeKeeper_Name);
            cls.AddParameter("@Symbol_TimeKeeper_Day", data.Symbol_TimeKeeper_Day);
            cls.AddParameter("@Symbol_TimeKeeper_Group", data.Symbol_TimeKeeper_Group);
            cls.AddParameter("@Symbol_TimeKeeper_Note", data.Symbol_TimeKeeper_Note);
            return cls.ExecuteNonQuery("sp_MCK_Symbol_TimeKeeper_Update");
        }
        #endregion

        #region Delete
        public bool Delete_MCK_Symbol_TimeKeeper(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Symbol_TimeKeeper_ID", id);
            return cls.ExecuteNonQuery("sp_MCK_Symbol_TimeKeeper_DeleteRow");
        }
        #endregion
    }
}